package com.example.finalassignment.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 自定义异常(服务器的)
 */

public class ServiceException extends RuntimeException {
    private Integer code;

    public ServiceException(){

    }

    public ServiceException(Integer code) {
        super("服务器异常");
        this.code = code;
    }

    public ServiceException(Integer code,String msg) {
        super(msg);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
